#include "widget.h"
#include "ui_widget.h"
#include <QPluginLoader>


Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_btn_test_clicked()
{
       PluginInterface *interface = nullptr;
       QPluginLoader pluginLoader("plugin.dll");
       QObject *plugin = pluginLoader.instance();
       if(plugin)
       {
           interface = qobject_cast<PluginInterface*>(plugin);
           if(interface)
           {
               interface->SayHello(this);
           }
       }

}
